package com.lifu.yygh.hosp.controller;

import com.lifu.yygh.common.result.Result;
import com.lifu.yygh.hosp.service.DepartmentService;
import com.lifu.yygh.model.hosp.Department;
import com.lifu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description
 * @Author lifu
 * @Date 2021/5/15 20:38
 */
@Api(tags = "科室管理")
@RestController
@RequestMapping(value = "/admin/hosp/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    //根据医院的编号，查询医院的所有科室列表
    @ApiOperation(value = "根据医院的编号，查询医院的所有科室列表")
    @GetMapping(value = "/getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok(list);
    }

}
